package main

import "fmt"

func main() {
	a := factorial(5)
	fmt.Printf("a: %v\n", a)
	yanghui(12)
}
func factorial(n uint) uint {
	if n == 1 {
		return 1
	}
	return n * factorial(n-1)

}
func yanghui(n uint) {
	for i := 1; i <= int(n); i++ {
		for k := 0; k < int(n)-i; k++ {
			fmt.Printf("%-3s", "")
		}
		for j := i; j >= 1; j-- {
			fmt.Printf("%-3d", j)
		}
		fmt.Println()
	}
}

// 批改意见
// 阶乘没有考虑n<=0时的特殊情况